<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\User;
use App\Models\Studying;
class CreateStudyingInfo extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'fix:studyinginfo {user_id}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $class_id_arr = [11,5, 9,10, 4, 8, 12, 6, 13, 16];
        $user_id = $this->argument('user_id');

        foreach($class_id_arr as $class_id){
            $studying = new Studying();
            $studying->user_id = $user_id;
            $studying->course_class_id = $class_id;
            $studying->save();
        }
    }
}
